<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script src="../lib/promise.js"></script>
<script>
    new Promise((resolve, reject) => {
        reject(2);
    }).then((value) => { //没有捕获，交给下一个then或catch处理
        console.log('onResolved()', value);
    }).then((value) => {
        console.log('onResolved2()', value);
    }, (reason) => {     //捕获了，但不处理，继续往下抛
        console.log('onRejected2()', reason);
        return new Promise((resolve, reject) => reject(3));
    }).then((value) => {
        console.log('onResolved3()', value);
    }, (reason) => {     //捕获了，但不处理，继续往下抛
        console.log('onRejected3()', reason);
        throw 4;
    }).catch((reason) => {
        console.log('catch', reason);
    }).then((value) => {
        console.log('onResolved4()', value);
    }, (reason) => {
        console.log('onRejected4()', reason);
    });
</script>
</body>
</html>
